Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

replace usage of options with cli #95

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

replace usage of options with cli #95

wants to merge 5 commits into from

Conversation

mfelsche
Copy link
Contributor

@mfelsche mfelsche commented Nov 20, 2018

and do the necessary refactoring.

Fixes #92

@mfelsche
Copy link
Contributor Author

there is some flakyness in how errors are printed to stderr, gonna investigate how to fix this.

@SeanTAllen
Copy link
Member

@mfelsche should this be "do not merge for now"?

@mfelsche
Copy link
Contributor Author

mfelsche commented Dec 2, 2018

This is good to go from my side. Fixed the test issue. Depends on if you want to have the renaming get merged first.

Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, this looks good. One question regarding a log message.

(⚠️ didn't pull this down and try it myself)

stable/main.pony Show resolved Hide resolved
@srenatus
Copy link
Contributor

I've built this locally and took it for a spin.

One change in behaviour I've noticed is when using stable env CMD with a CMD that has parameters. Concretely: with stable from master, I could do

$ stable env ponyc --debug jylis/

with this branch, it fails,

$ stable env ponyc --debug jylis/
Error: unknown long option at: 'debug'

usage: stable [<options>] <command> [<args> ...]
[...]

but passes when using --:

$ stable env -- ponyc --debug jylis/

Now, I'm not saying that this is incorrect -- my expectations aren't violated, putting -- after stable env is the proper thing to do in this case -- it's just a small change in behaviour we might want to make users aware of when releasing this? 😃

@mfelsche
Copy link
Contributor Author

This change was actually not intended, but it makes total sense to me. Previously it was interpreting a simple call of stable env as calling the env executable, which might not be intended after all. So this explicit separation with -- is an improvement imho.

I just think, I need to update the documentation in that respect. And check if cli catches all edge-cases. Gonna update the PR shortly.

@mfelsche
Copy link
Contributor Author

mfelsche commented Jan 1, 2019

@jemc and @SeanTAllen do you have an opinion on the change introduced with this PR? Namely, that now instead of:

stable env ponyc --debug

one has to (and should, even without any flags) write:

stable env -- ponyc --debug

Otherwise the cli machinery is not able to differentiate between flags for stable or stable env and flags for the subcommand. and would interpret the --debug as part of the stable cli definition, which it isnt, and it would thus fail.

While this seems like an accident, i think it is changing the stable cli for good.
What do you think?

@jemc
Copy link
Member

jemc commented Jan 8, 2019

I'm okay with that change, although it does break all of my Makefiles, and likely will for others as well, so we need to make sure the change is well-advertised.

@mfelsche
Copy link
Contributor Author

mfelsche commented Jan 8, 2019

I think it would make sense, to include that change in one go, shortly before we transition the name to tack, so we have a clean cut.

@SeanTAllen
Copy link
Member

Discussed at Sync. We will merge this once we renamed to tack

Makefile Outdated
PONYC = ponyc
else
PONYC = ponyc --debug
PONYC ?= ponyc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm reverting this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I am fine with this. I am just used to use stuff with a version of pony i do not have on the path. And overwriting the used ponyc from PATH by setting the environment variable PONYC, helped me a lot.

doc/cli/stable-env.md Outdated Show resolved Hide resolved
@mfelsche
Copy link
Contributor Author

Feels weird to approve my own PR. But this is good to go from my side, if it is good for you @SeanTAllen

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use cli package to define the command line instead of deprecated options package
4 participants